/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mapping;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Andres
 */
@Embeddable
public class CambioCompPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "idTicket")
    private String idTicket;
    @Basic(optional = false)
    @Column(name = "idComponente")
    private int idComponente;

    public CambioCompPK() {
    }

    public CambioCompPK(String idTicket, int idComponente) {
        this.idTicket = idTicket;
        this.idComponente = idComponente;
    }

    public String getIdTicket() {
        return idTicket;
    }

    public void setIdTicket(String idTicket) {
        this.idTicket = idTicket;
    }

    public int getIdComponente() {
        return idComponente;
    }

    public void setIdComponente(int idComponente) {
        this.idComponente = idComponente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTicket != null ? idTicket.hashCode() : 0);
        hash += (int) idComponente;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CambioCompPK)) {
            return false;
        }
        CambioCompPK other = (CambioCompPK) object;
        if ((this.idTicket == null && other.idTicket != null) || (this.idTicket != null && !this.idTicket.equals(other.idTicket))) {
            return false;
        }
        if (this.idComponente != other.idComponente) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.mapping.CambioCompPK[ idTicket=" + idTicket + ", idComponente=" + idComponente + " ]";
    }
    
}
